﻿holy_warrior = { # Generico Crusader legend
	type = heroic
	quality = famed
	is_shown = {
		has_dlc_feature = legends
		faith = {
			OR = {
				has_doctrine_parameter = great_holy_wars_active
				has_doctrine_parameter = great_holy_wars_active_if_reformed
			}
		}
		has_trait = crusader_king
	}
	is_valid = {
		has_trait = crusader_king
	}

	chronicle = holy_warrior
	chronicle_properties = {
		ancestor = root
		religion = root.religion
	}
}

holy_site = { # Holy Site
	type = holy
	quality = famed
	is_shown = {
		has_dlc_feature = legends
		is_landed = yes
		faith = {
			any_holy_site = {
				OR = {
					county.holder = root
					county.holder.top_liege = root
				}
			}
		}
	}
	is_valid = {
		piety_level >= very_high_piety_level
	}

	chronicle = saintly_location
	chronicle_properties = {
		location = root.location
		religion = root.religion
		faith = root.faith
	}
}

#Dynasty perk
ce1_heroic_legacy_1 = {
	type = legitimizing
	quality = famed
	is_shown = {
		dynasty ?= {
			has_dynasty_perk = ce1_heroic_legacy_1
			NOT = {
				exists = var:dynasty_legend_used
			}
		}
	}
	is_valid = {
		is_landed = yes
		OR = {
			is_ai = no
			# Prevent the AI from sniping the seed from the player
			AND = {
				is_ai = yes
				NOT = {
					dynasty = { any_dynasty_member = { is_ai = no } }
				}
			}
		}
	}
	chronicle = great_deed_dynasty
	chronicle_properties = {
		founder = house.house_founder
		dynasty = dynasty
		title = primary_title
	}
}
